package com.gesee.zyspps.adapter;

import java.util.List;

import com.gesee.zys.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class TestAdapter extends BaseAdapter
{
    private Context context;
    private List<String> list;
    private LayoutInflater mInflater;
    
    public void setAdapter(Context context)
    {
        this.context = context;
    }
    
    public void setList(List<String> list)
    {
        this.list = list;
    }
    
    @Override
    public int getCount()
    {
        // TODO Auto-generated method stub
        return list.size();
    }

    @Override
    public Object getItem(int position)
    {
        // TODO Auto-generated method stub
        return list.get(position);
    }

    @Override
    public long getItemId(int position)
    {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent)
    {
        // TODO Auto-generated method stub
        ViewHolder viewHolder = null;
        if (viewHolder == null)
        {
            convertView = LayoutInflater.from(context).inflate(R.layout.activity_add_leibie, null);
            viewHolder = new ViewHolder();
            viewHolder.come_back = (ImageView) convertView.findViewById(R.id.come_back);
            convertView.setTag(viewHolder);
        }
        else
        {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.come_back.setTag("url");
        viewHolder.come_back.setImageResource(R.drawable.background_button);
        
        return convertView;
    }
    
    class ViewHolder
    {
        ImageView come_back;
    }

}
